package test5;

import java.io.*;
import java.net.*;
import java.util.*;

/**
 * This program makes a socket connection to the atomic clock in Boulder, Colorado, and prints the
 * time that the server sends.
 * @version 1.20 2004-08-03
 * @author Cay Horstmann
 */

//201521123046
public class SocketTest
{
   public static void main(String[] args)
   {
      try
      {
         Socket s = new Socket("192.168.191.1", 8190);
         try
         {
        	InputStream input = s.getInputStream();
        	PrintWriter out = new PrintWriter(s.getOutputStream());
            Scanner input1 = new Scanner(input);
            Scanner input2 = new Scanner(System.in);
            while (input1.hasNextLine())
            {
               String line1 = input1.nextLine();
               System.out.println(line1);
               String line2 = input2.nextLine();
               out.println(line2);
               out.flush();
            }
         }
         finally
         {
            s.close();
         }
      }
      catch (IOException e)
      {
         e.printStackTrace();
      }
   }
}
